package com.bwda.dsrs.filecenter.service;

import com.bwda.dsrs.filecenter.domain.po.dbinfo.DbInfoPo;
import com.bwda.dsrs.filecenter.domain.po.dbscanresult.DbScanResultPo;

import java.sql.Connection;
import java.util.List;
import java.util.Map;


/**
 * Remote service
 * @author Administrator
 */
public interface IRemoteService {
     /**
      * Login connection
      *
      * @param dbInfoPo db info po
      * @return the connection
      * @throws Exception exception
      */
     Connection login (DbInfoPo dbInfoPo) throws Exception ;

     /**
      * Gets data *
      *
      * @param connection connection
      * @param tableName  table name
      * @param columnName column name
      * @param rowNum     row num
      * @param sumRowNum  sum row num
      * @return the data
      * @throws Exception exception
      */
     List<Map<String,Object>> getData(Connection connection, String tableName,String columnName, Integer rowNum,Integer sumRowNum) throws Exception;

     /**
      * Gets all db list *
      *
      * @param connection connection
      * @param dbInfoPo   db info po
      * @return the all db list
      * @throws Exception exception
      */
     List<String> getAllDBList(Connection connection,DbInfoPo dbInfoPo)throws Exception;

     /**
      * Gets all table list *
      *
      * @param connection connection
      * @param dbName     db name
      * @return the all table list
      * @throws Exception exception
      */
     List<String> getAllTableList(Connection connection,String dbName)throws Exception;

     /**
      * Gets table columns *
      *
      * @param connection connection
      * @param tableName  table name
      * @return the table columns
      * @throws Exception exception
      */
     List<DbScanResultPo> getTableColumns(Connection connection,String tableName) throws Exception;

     /**
      * Count row num integer
      *
      * @param connection connection
      * @param tableName  table name
      * @return the integer
      * @throws Exception exception
      */
     Integer countRowNum(Connection connection,String tableName) throws Exception;

     /**
      * Count table integer
      *
      * @param connection connection
      * @param dbName     db name
      * @return the integer
      * @throws Exception exception
      */
     Integer countTable(Connection connection,String dbName) throws Exception;

     /**
      * Count view integer
      *
      * @param connection connection
      * @return the integer
      * @throws Exception exception
      */
     Integer countView(Connection connection) throws Exception;

     /**
      * Count function integer
      *
      * @param connection connection
      * @return the integer
      * @throws Exception exception
      */
     Integer countFunction(Connection connection) throws Exception;

     /**
      * Count sequence integer
      *
      * @param connection connection
      * @return the integer
      * @throws Exception exception
      */
     Integer countSequence(Connection connection) throws Exception;

     /**
      * url,用户名，密码查询权限下所有数据库
      *
      * @param dbInfoPo db info po
      * @return data bases
      * @throws Exception exception
      */
     List<Object> getDataBases(DbInfoPo dbInfoPo)throws Exception;
}
